package org.springframework.learn.beans.note.editor;

import java.beans.PropertyEditorSupport;

/**
 * Description 自定义的属性编辑器
 * Copyright © 启明星辰 版权所有
 *
 * @author chenjiquan
 * @date 2023-07-12
 */
public class AddressEditor extends PropertyEditorSupport {
	@Override
	public void setAsText(String text) throws IllegalArgumentException {
		String[] arr = text.split("_");
		Address address = new Address();
		address.setProvince(arr[0]);
		address.setCity(arr[1]);
		address.setTown(arr[2]);
		setValue(address);
	}
}
